//
//  StatusNormalCell.swift
//  Sina
//
//  Created by maling  on 15/11/12.
//  Copyright © 2015年 maling . All rights reserved.
//

import UIKit

class StatusNormalCell: StatusCellTableViewCell {

      /// 微博视图模型
    override var viewModel: StatusViewModel? {
    
        didSet {
        
            pictureView.snp_updateConstraints { (make) -> Void in
                // 根据配图数量 决定配图视图的顶部间距
                let offSet = viewModel?.thumbnailUrls?.count > 0 ? statusCellMargin : 0
                make.top.equalTo(contentLabel.snp_bottom).offset(offSet)
            }
        }
    }
    
    override func setupUI() {
        super.setupUI()
        
        // 3.》 配图视图
        pictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(contentLabel.snp_bottom).offset(statusCellMargin)
            make.left.equalTo(contentLabel.snp_left)
            make.width.equalTo(300)
            make.height.equalTo(90)
        }
    }
    
    
    
}
